import redis

class SeedURLManager:
    def __init__(self, redis_host='localhost', redis_port=6379, db=0):
        self.redis = redis.StrictRedis(host=redis_host, port=redis_port, db=db)
        self.seed_url_set_key = 'seed_urls'

    def add_seed_url(self, url):
        """添加种子URL到Redis集合中，Redis集合本身保证了元素的唯一性"""
        self.redis.sadd(self.seed_url_set_key, url)

    def get_seed_urls(self):
        """获取所有种子URL"""
        return self.redis.smembers(self.seed_url_set_key)